package com.icity.mapper;

import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import com.icity.entity.media.AppUser;

@Mapper
public interface MediaMapper {
    //查询菜单数量
	@Select("<script>"
			+"select count(id) from tbl_app_user where 1 = 1 and author_type = 2 and original_type = 1"
			+ "<if test='author_name != null'>"
			+ " and author_name like CONCAT('%','${author_name}','%' ) "
			+ "</if>"
			+ " </script>")
    int getAppUserCount(Map<Object,Object> map);

    //查询菜单
	@Select("<script>"
			+"select author_name,video_num,follow_num,com_num from tbl_app_user where 1 = 1 and author_type = 2 and original_type = 1"
			+ "<if test='author_name != null'>"
			+ " and author_name like CONCAT('%','${author_name}','%') "
			+ "</if>"
			+ " ORDER BY update_time desc "
			+ "limit #{page},#{limit}"
			+ " </script>")
    List<AppUser> getAppUserList(Map<Object,Object> map);

}
